import javax.print.DocFlavor;
import java.util.*;

public class Test {
    public static void main(String[] args) {
        Map<String ,Integer> map=new HashMap<>();
    }
    public static void main1(String[] args) {
      HashBuck hashBuck=new HashBuck();
      hashBuck.put(1,1);
      hashBuck.put(2,2);
      hashBuck.put(3,3);
      hashBuck.put(13,3);
      hashBuck.put(3,4);
        System.out.println(hashBuck);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            String str1=in.nextLine();
            String str2=in.nextLine();
            func(str1,str2);
        }
    }
    class Node {
        int val;
        Node next;
        Node random;

        public Node(int val) {
            this.val = val;
            this.next = null;
            this.random = null;
        }
    }
    public Node copyRandomList(Node head) {
        Node cur=head;
        Map<Node,Node> map=new HashMap<>();
      while(cur!=null){
          Node node=new Node(cur.val);
          map.put(cur,node);
          cur=cur.next;
      }
      cur=head;
      while(cur!=null){
          Node next=map.get(cur.next);
          map.get(cur).next=next;
          Node random=map.get(cur.random);
          map.get(cur).random=random;
      }
      return map.get(cur);
    }
    private static void func(String s1,String s2){
        s1=s1.toUpperCase();
        s2=s2.toUpperCase();
        Set<Character> set1=new HashSet<>();

        for (int i = 0; i < s2.length(); i++) {
            set1.add(s2.charAt(i));
        }
        Set<Character> set2=new HashSet<>();
        for (int i = 0; i < s1.length(); i++) {
            if(!set1.contains(s1.charAt(i)) && !set2.contains(s1.charAt(i))){
               set2.add(s1.charAt(i));
                System.out.print(s1.charAt(i));
            }
        }
    }
    public int numJewelsInStones(String jewels, String stones) {
        Set<Character> set=new HashSet<>();
        for (int i = 0; i < jewels.length(); i++) {
            set.add(jewels.charAt(i));
        }
        int count=0;
        for (int i = 0; i < stones.length(); i++) {
            if(set.contains(stones.charAt(i))){
                count++;
            }
        }
        return count;
    }
}
